home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 016a / pmap202.zip / PMAP.DOC next >
Text File  |  1990-07-15  |  43KB  |  941 lines

  1.  
  2.                                    PMAP 2.02
  3.                                    ---------
  4.  
  5.         PMAP (Program MAP) displays how your PC's RAM is being used.  It
  6.         lists all active programs (including resident programs such as
  7.         Sidekick and PCED), displays free memory areas and their
  8.         locations, identifies device drivers, summarizes expanded memory
  9.         (EMS) use, and details certain DOS data areas.
  10.  
  11.         | identifies information about new features for PMAP 2.0.
  12.  
  13.         Version 2.02 is a primarily a bugfix and fine-tuning release.
  14.         Changes to operation other than bug corrections are minor.
  15.  
  16.  
  17.         Syntax summary
  18.         --------------
  19.         The command line syntax of PMAP is:
  20.  
  21.             pmap [/defkqrsvx?] [program-list]
  22.  
  23.         The option /switches are:
  24.  
  25.                 d   display detail list of allocation by programs
  26.       |         e   display programs' environments
  27.       |         f   display names of open files
  28.       |         k   display data area of DOS kernel
  29.       |         q   quick display
  30.                 r   display raw list of memory blocks
  31.                 s   display only standard DOS memory
  32.                 v   display device driver information
  33.                 x   display only expanded memory
  34.                 ?   display syntax summary
  35.  
  36.         The option switches are explained in detail below.
  37.  
  38.         The program-list, if present, restricts the display to the
  39.         listed programs.  Named programs may contain wildcards (*).
  40.  
  41.         Examples:
  42.  
  43.           pmap            (default display)
  44.           pmap /r         (raw display)
  45.           pmap /f sdump   (detail display of program SDUMP only)
  46.           pmap sdump c*   (display SDUMP and anything beginning with C)
  47.           pmap /x         (display only expanded memory usage)
  48.           pmap /v         (display only device driver data)
  49.           pmap /k         (display DOS kernel data only)
  50.  
  51.         Multiple switches may be specified together or separately.  All
  52.         of these are valid and equivalent:
  53.  
  54.             pmap /f /d
  55.             pmap /fd
  56.             pmap /f/d
  57.  
  58.       | If you wish to set "permanent" options, i.e., options that will
  59.       | be in effect for every PMAP run, set an environment variable
  60.       | called PMAP to contain the desired option switches.  For
  61.       | example, if you always want a detail list of standard memory
  62.       | only:
  63.       |
  64.       |     SET PMAP=/d /s     (or /ds)
  65.       |
  66.       | In this case, options D and S will be applied to every PMAP run.
  67.       |
  68.       | To "counter" a permanent option set in the PMAP variable, add
  69.       | a '*' to the switch.  For example, if the variable is set as
  70.       | above but you do not want the detail list, use /D*:
  71.       |
  72.       |     pmap /d*
  73.       |
  74.       | The /F and /K options are available only under DOS 3.0 or later.
  75.       |
  76.       | Only one of /R, /K, and /V can be used per run.  If more than
  77.       | one is specified, the order of precedence is: /V, /K, /R.
  78.       |
  79.       | Note: if you have changed your switch character (SWITCHAR) from
  80.       | '/' to something else, use the new SWITCHAR for PMAP switches.
  81.  
  82.  
  83.         Standard display
  84.         ----------------
  85.         When PMAP is invoked without parameters, you'll see a display
  86.         similar to this:
  87.  
  88.  
  89.           Addr Program   Parent    Parameters     Han Blks   Size    Vectors
  90.           ---- -------  -------- ---------------  --- ----  -------  -------
  91.           147D command  command  main               0    2     3888  2E
  92.           157B nmi      command  /i/q               0    2     1856  02
  93.           15F2 cache-em command  500                0    2    13168  13 19
  94.           193E dbase    command  /C d:command      16    2   238384  30
  95.           ...
  96.       |   Other allocated blocks                         4    81296
  97.           Total conventional free memory                 4   451696
  98.           Largest conventional free block                    371168
  99.           Extended memory available                          425984
  100.           Next program will load at 5579
  101.  
  102.         Each program that is currently in memory is displayed.  Fields
  103.         are as follows:
  104.  
  105.             Addr        The memory segment at which the program is
  106.       |                 loaded, in hexadecimal.  If an asterisk (*)
  107.       |                 follows the address, the program is loaded
  108.       |                 into a disconnected high memory chain (see
  109.       |                 below).
  110.  
  111.             Program     The name of the program, if available.  "n/a"
  112.                         indicates that the name is not available.  The
  113.                         program name is never available under DOS 2.x.
  114.  
  115.             Parent      The name of the program's "parent".  In most
  116.                         cases, this will be "command", because most
  117.                         programs are run by COMMAND.COM (i.e., from
  118.                         the DOS prompt).  See below.
  119.  
  120.             Parameters  The command line parameters that were specified
  121.                         when the program was run.  Some programs re-use
  122.                         the area where the parameters are stored, in
  123.                         which case a "??" will be displayed.  An
  124.                         ellipsis ("...") at the end indicates that there
  125.                         were more parameters than could fit here.
  126.  
  127.             Han         The number of open handles (or files) associated
  128.                         with the owner.  See below.
  129.  
  130.             Blocks      The number of memory blocks that are owned by
  131.                         the program.
  132.  
  133.             Size        The total size of all blocks owned by the
  134.                         program.
  135.  
  136.             Vectors     A list of 80x8x interrupt vectors that appear to
  137.                         have been "intercepted" by the program.
  138.  
  139.         In the example, the program NMI is loaded at memory segment
  140.         157BH and was run directly from the DOS prompt or from a batch
  141.         file.  The original parameters were "/i/q".  DOS has allocated
  142.         two blocks of memory for the program, and they total 1856 bytes
  143.         in size.  Vector 2 (nonmaskable interrupt) has been
  144.         "intercepted" by NMI.
  145.  
  146.       | "Other allocated blocks" refer to blocks of memory that are not
  147.       | free but also are not owned by any executable program that PMAP
  148.       | can identify.  They may be owned by device drivers or by DOS
  149.       | itself; or they may in fact be owned by executable programs but
  150.       | not indicated as such.  PMAP may be able to make an educated
  151.       | guess as to the true owner; if so, the probable name of the
  152.       | program will be indicated in parentheses when you use the /D
  153.       | option switch (see below).
  154.  
  155.         At the end of the list, PMAP indicates the number of blocks of
  156.         free memory, the total size of all free blocks, the largest
  157.         single free block, and the segment address at which the next
  158.         program will probably load.
  159.  
  160.         The amount of available extended memory (memory above the 1
  161.         megabyte mark) is displayed only if any such memory is actually
  162.         reported by the system as currently available for use.
  163.  
  164.         You can restrict the display to certain programs by naming them
  165.         on the command line.  For example, the command
  166.  
  167.             pmap sdump ced
  168.  
  169.         would display information for the SDUMP and CED programs, and no
  170.         others.  The summary and expanded memory information is always
  171.         displayed.
  172.  
  173.         You can use a single wildcard '*' at the end of any named
  174.         program in the list.  For example,
  175.  
  176.             pmap sd* c*
  177.  
  178.         would display information for all programs beginning with
  179.         "sd" or "c".
  180.  
  181.         NOTE:  "below" the first program loaded in memory (usually
  182.         COMMAND.COM), there is a block of memory allocated by DOS for
  183.         device drivers, etc.  PMAP does not show this block in its
  184.       | standard display; its size is indicated under "Other allocated
  185.       | blocks" area if you request a detailed listing (/D), and further
  186.       | detail is available with the /K switch (see below).
  187.  
  188.  
  189.         Detail display (/D)
  190.         -------------------
  191.         When you run PMAP with the /D (Detail) parameter, you'll see the
  192.         same display, except that PMAP will show a detailed list of
  193.         memory blocks allocated for each program.  For example:
  194.  
  195.          Addr Program  Parent    Parameters  Han Blks  Size   Vectors
  196.          ---- ------- -------- ------------- --- ---- ------- -------
  197.          1666 kbfix2  command  /KT1 /D0...     0    2    2560 08 09 16
  198.          1661  Environment                                 64
  199.          1666  Program                                   2496
  200.  
  201.         KBFIX2 has two memory blocks allocated to it; PMAP shows the
  202.         size of each block and its address, and makes an educated guess
  203.         as to what the block is used for.
  204.  
  205.         You may include a list of specific programs to be displayed:
  206.  
  207.             pmap sdump ced /d
  208.  
  209.         PMAP also displays a detail list of all free blocks of memory
  210.       | and of "other allocated blocks".
  211.  
  212.  
  213.       | Environment display
  214.       | -------------------
  215.       | If you add a /E switch, PMAP will display the contents of each
  216.       | program's environment (if there is one).  For example, the
  217.       | command:
  218.       |
  219.       |     pmap rxrun /e
  220.       |
  221.       | might display something like this:
  222.       |
  223.       |  Addr Program  Parent    Parameters  Han Blks  Size   Vectors
  224.       |  ---- ------- -------- ------------- --- ---- ------- -------
  225.       |  B6D4  rxrun  command                  0    2    1536
  226.       |  Environment [B7E3]
  227.       |    COMSPEC=C:\COMMAND.COM
  228.       |    PATH=C:\UTIL;C:\DOS
  229.       |    PROMPT=$p$g
  230.       |    [name] C:\BOOT\RXRUN.COM
  231.       |
  232.       | The [B7E3] represents the segment address at which the
  233.       | environment is located.
  234.       |
  235.       | The [name] field appears only under DOS 3.0 and later; it shows
  236.       | the contents of the area of the environment where the full path
  237.       | and name of the program are stored.  In some cases (especially
  238.       | in the case of COMMAND.COM), garbage may in fact be stored in
  239.       | this area.  If PMAP think that the field is invalid, it will
  240.       | report "[name field invalid]"; however, PMAP may display invalid
  241.       | data if the contents of the field look like displayable characters.
  242.  
  243.  
  244.       | Open files display (/F)
  245.       | -----------------------
  246.       | If the HAN field in the standard display is non-zero, the named
  247.       | program currently has files that are open.  You can display the
  248.       | names of these files by adding the /F option.  For example:
  249.       |
  250.       |  Addr Program  Parent    Parameters  Han Blks  Size   Vectors
  251.       |  ---- ------- -------- ------------- --- ---- ------- -------
  252.       |  12CD  command  command  /f            1    2  4176  22 23 24 2E
  253.       |  Open files: D:FOPT.TXT
  254.       |
  255.       | This feature is available only under DOS 3.0 and later and is
  256.       | mutually exclusive with the /Q (Quick) switch.
  257.  
  258.  
  259.       | Quick display (/Q)
  260.       | ------------------
  261.       | Some of what PMAP does can be somewhat time consuming on slower
  262.       | computer systems, and one task may fail under some versions of
  263.       | DOS.  If you would like PMAP to run slightly faster (about 1/2
  264.       | second on a 4.77Mhz machine if you have EMS) or if PMAP fails
  265.       | with an error message similar to:
  266.       |
  267.       |         pmap: error tracing buffer chain
  268.       |
  269.       | then use the /Q (Quick) option switch.  With /Q set, PMAP will
  270.       | not:
  271.       |
  272.       |     1. Search for a disconnected high memory chain, or
  273.       |     2. Look for buffers, files, stacks, etc.
  274.       |
  275.       | The /K and /F options cannot be used with /Q.  Also note that /Q
  276.       | will have little effect on PMAP's speed unless you have expanded
  277.       | memory (EMS), and that /Q is automatically set for DOS versions
  278.       | prior to 3.0.
  279.       |
  280.       | Remember, if you always want to use the /Q switch, you can
  281.       |
  282.       |     SET PMAP=/Q
  283.       |
  284.       | in your environment.
  285.  
  286.  
  287.       | Kernel display (/K)
  288.       | -------------------
  289.       | Below the first program loaded into memory (usually COMMAND.COM)
  290.       | there is an area of memory used by DOS for storage of code and
  291.       | data.  This area is broken into three major sections:
  292.       |
  293.       |     1. IBMBIO's code and data.  This is always located at memory
  294.       |     segment 0070h and contains the basic code and data for
  295.       |     system input/output services.  The default device drivers
  296.       |     (for the printer, screen, and keyboard, etc.) are also
  297.       |     located here.
  298.       |
  299.       |     2. IBMDOS's basic code and data.  This is located in memory
  300.       |     immediately following IBMBIO's area and contains the "guts"
  301.       |     of DOS.  This area usually includes space for five FILES
  302.       |     and one BUFFER.
  303.       |
  304.       |     3. A supplementary DOS data area.  This area may include:
  305.       |         - your FCBs; the size is affected by the FCBS option
  306.       |           in your CONFIG.SYS.
  307.       |         - any FILES beyond the initial number (usually 5) that
  308.       |           are stored in the IBMDOS area.  This size of this area
  309.       |           is determined by the FILES option in CONFIG.SYS.
  310.       |         - any BUFFERS beyond the initial number (usually 1) that
  311.       |           are stored in the IBMDOS area.  The size of this area
  312.       |           is determined by the BUFFERS option in CONFIG.SYS.
  313.       |         - your logical drive table.  There is one entry in this
  314.       |           table for each drive up to LASTDRIVE.
  315.       |         - your DOS STACKS, if any (DOS 3.1 or later only).  The
  316.       |           size of this area is determined by the STACKS option
  317.       |           in CONFIG.SYS.
  318.       |         - any externally loaded device drivers such as ANSI.SYS.
  319.       |
  320.       | To display a detailed map of the complete DOS memory area (all
  321.       | three of the above), use the /K option.  The display might look
  322.       | something like this:
  323.       |
  324.       |    MCB Addr  End   Size  Contents
  325.       |   ---- ---- ----  -----  --------
  326.       |    --  0070 0279   8352  IBMBIO [includes 13 device drivers]
  327.       |    --  027A 09C7  29920  IBMDOS [includes 5 files, 1 buffer]
  328.       |   09C8 09C9 1282  35760  DOS data/drivers
  329.       |
  330.       |   DOS data/drivers area detail:
  331.       |        09C9 0E9B  19760    8 device drivers (PMAP /V for detail)
  332.       |        0E9C 0F10   1872   35 files
  333.       |        0F11 0F1E    224    4 FCBs
  334.       |        0F1F 1191  10032   19 buffers
  335.       |        1192 11B5    576    7 logical drives
  336.       |        11B6 1282   3280    9 stacks (128 bytes each)
  337.       |
  338.       | The first section shows the locations and sizes of the three
  339.       | major areas used by DOS.  In this case, for example, area 2 (the
  340.       | basic IBMDOS code/data area) begins at memory segment 027Ah and
  341.       | is 29,920 bytes in size.  It includes five files and one buffer.
  342.       |
  343.       | The MCB field, which only appears for area 3, shows the address
  344.       | of the memory control block for the area.  This is part of DOS's
  345.       | memory management scheme and is decribed in greater detail later
  346.       | in this manual.  Areas 1 and 2 are not part of DOS's official
  347.       | memory chain, so they have no MCBs.
  348.       |
  349.       | The second section breaks down the contents of area 3 in greater
  350.       | detail.  In the example system, eight device drivers are
  351.       | loaded and the system is configured as follows:
  352.       |
  353.       |         FILES=40
  354.       |         BUFFERS=20
  355.       |         LASTDRIVE=G
  356.       |         STACKS=9,128
  357.       |         FCBS=4,0
  358.       |
  359.       | The display shows the exact location and size of each of these
  360.       | items.  For example, the extra 19 buffers (there's one in area
  361.       | 2, leaving 19 of the 20 for area 3) are located at memory
  362.       | segment 0F1Fh and extend through the end of memory segment
  363.       | 1191h, a total of 10,032 bytes.
  364.       |
  365.       | If you use an extender program such as QEMM's FILES.COM to
  366.       | increase the number of FILES after bootup, storage for the extra
  367.       | files will be located elsewhere in the memory chain--not in
  368.       | any of the DOS data areas described.  PMAP will display such
  369.       | areas in a separate section if there are any.  For example, if
  370.       | we ran:
  371.       |
  372.       |     FILES + 2
  373.       |
  374.       | to increase the maximum number of files from 40 to 42, the
  375.       | display might appear as follows:
  376.       |
  377.       |     Additional memory block(s) used for DOS data:
  378.       |      MCB Addr  End   Size  Contents
  379.       |     ---- ---- ----  -----  --------
  380.       |     1897 1898 18C8    784
  381.       |       >> 18C1 18C7    112   2 files
  382.       |
  383.       | This shows that the 944-byte block from 1403h to 143Dh (with MCB
  384.       | at 1402h) is used for supplementary DOS data.  Within this
  385.       | 944-byte allocation, the 272 bytes from memory segments 142Ch
  386.       | through 143Ch contain the actual storage for information about
  387.       | the five files.
  388.       |
  389.       | Note also that, if there are additional blocks such as these,
  390.       | they are identified in the standard program display if you use
  391.       | the /D (detail) option.  The above might look something like
  392.       | this in the detail display:
  393.       |
  394.       |  Addr Program  Parent    Parameters  Han Blks  Size   Vectors
  395.       |  ---- ------- -------- ------------- --- ---- ------- -------
  396.       |  1898 n/a     command  +2              0    1     784
  397.       |  1898   2 files                                   784
  398.       |
  399.       | The /K option is available only under DOS 3.0 and later.
  400.  
  401.  
  402.         Raw display
  403.         -----------
  404.         When you run PMAP with the /r (Raw) parameter, you'll see a
  405.         display like this:
  406.  
  407.             T  MCB  Addr  Owner  Para    Bytes
  408.             - ----  ----  -----  ----  --------
  409.             M 0974  0975   0008  0AFA     44960
  410.             M 146F  1470   1470  00C3      3120
  411.             M 1533  1534   1470  0020       512 GLVMGR
  412.                [more of the same]
  413.             M 1DF3  1DF4   1DF4  0706     28768
  414.             M 24FA  24FB   2500  0004        64 [pmap]
  415.             M 24FF  2500   2500  1376     79712 [pmap]
  416.             Z 3876  3877   0000  6789    424080
  417.  
  418.         This is an uninterpreted list of all blocks of memory allocated
  419.         by DOS (see below).  The fields are as follows:
  420.  
  421.             Type        The block type.  There are only two block types,
  422.                         type M and type Z.  The last block in the
  423.                         chain is type Z, and all others are type M.
  424.  
  425.             MCB         The segment address of the Memory Control Block
  426.                         (sometimes known as an arena header).
  427.  
  428.             Addr        The segment address of the memory block itself.
  429.                         This is always equal to the MCB address plus
  430.                         one.
  431.  
  432.             Owner       The segment address of the program that "owns"
  433.                         the block of memory.  If this is 0000, the block
  434.                         is unallocated or "free".
  435.  
  436.             Para        The size of the block, in paragraphs (16 bytes).
  437.  
  438.             Bytes       The size of the block, in bytes.
  439.  
  440.         All numbers are hexadecimal except "bytes", which is decimal.
  441.  
  442.         The [pmap] suffix after an allocated block indicates that the
  443.         block is being used by PMAP.  When PMAP terminates, this block
  444.         will be free (unallocated).  The standard (non-raw) PMAP display
  445.         understands this, and displays the map as if PMAP weren't there.
  446.  
  447.       | Following some lines on the display you may see a one- to
  448.       | eight-character string:
  449.       |
  450.       |     T  MCB  Addr  Owner  Para    Bytes
  451.       |     - ----  ----  -----  ----  --------
  452.       |     M 1533  1534   1470  0020       512 GLVMGR
  453.       |
  454.       |
  455.       | Under DOS 4.0 and later, a program name may appear in the last
  456.       | eight bytes of a memory control block (which is what the raw
  457.       | display is showing).  Under DOS versions prior to 4.0, DOS does
  458.       | not place the program name in this location, but some other
  459.       | programs (such as 386MAX and QEMM) may do so.  If PMAP thinks
  460.       | that the contents of the last eight bytes of the MCB look like a
  461.       | readable string, it will display the string.  This may provide
  462.       | some information about the owner of the block.  In some cases,
  463.       | the information in this area may be garbage that happens to
  464.       | consist of all ASCII characters--and these will be displayed.
  465.       | You should be able to tell at a glance which strings are
  466.       | meaningful and which are not.
  467.       |
  468.       | If PMAP is able to identify a disconnected high memory chain, it
  469.       | will display the line:
  470.       |
  471.       |     Disconnected high memory chain:
  472.       |
  473.       | between the regular low-RAM DOS memory chain and the "hidden"
  474.       | high memory chain.
  475.  
  476.         If the /R switch is included, all other command line parameters
  477.         are ignored.
  478.  
  479.  
  480.         Expanded memory display
  481.         -----------------------
  482.         If expanded (LIM or EEMS) memory is present, PMAP displays EMS
  483.         allocation as follows:
  484.  
  485.             Expanded memory summary:
  486.  
  487.                     Block      Size    Name
  488.                     -----    -------   ----
  489.                     0         589824   SYSTEM
  490.                     1         425984
  491.                     2          16384   CDIR
  492.                     3          65536   HINDSITE
  493.                     ...
  494.                     Free      327680
  495.                     Total    2097152
  496.                     Page frame segment: CC00h
  497.  
  498.         The NAME field will be present only if your expanded memory
  499.         manager supports the LIM 4.0 specification, and then only for
  500.         programs that have defined their names to the system.
  501.  
  502.         EMS memory uses a "page frame" that maps a 64K block (actually,
  503.         four 16K "pages") of EMS memory into standard 80x8x memory.
  504.         The segment to which this memory is mapped is also displayed.
  505.  
  506.         If you only want to display the expanded memory allocation, use
  507.         the /X switch.  To suppress the display of expanded memory, use
  508.         /S.
  509.  
  510.  
  511.         Device driver display
  512.         ---------------------
  513.         If you execute PMAP with the /V switch, it will display a table
  514.         of information about your installed device drivers.  No other
  515.         data (i.e., no memory maps) are displayed when /V is selected.
  516.  
  517.         The first five columns of the table contain the following
  518.         fields:
  519.  
  520.             Name        If the device is a character device, the device
  521.                         name.  If it is a block device (like a disk),
  522.                         this will be "Blk (n)", where n is the number
  523.                         of units handled by this device.
  524.  
  525.             Address     The address where the device driver begins in
  526.                         memory, in standard hex segment:offset form.
  527.  
  528.             Size        The approximate size (in bytes, displayed in
  529.                         decimal) of the device driver.  See below.
  530.  
  531.             Strt        The entry point of the driver's strategy
  532.                         routine.  This is the hex offset within the
  533.                         device driver's segment (shown under ADDRESS).
  534.  
  535.             Intr        The entry point of the driver's interrupt
  536.                         routine.  This is the hex offset within the
  537.                         device driver's segment (shown under ADDRESS).
  538.  
  539.         The remaining columns are bit fields with the driver's attribute
  540.         record.  In each case, an asterisk indicates that the bit is
  541.         set (1), and a space indicates that it is reset (0).
  542.  
  543.             CHR         *    = this is a character device
  544.                         <sp> = this is a block device.
  545.  
  546.             IOC         *    = device supports IOCTL calls
  547.  
  548.             IBM    for block devices:
  549.                         *    = non-IBM format
  550.                    for character devices:
  551.                         *    = supports output-until-busy
  552.  
  553.             RMV         *    = supports removable media
  554.  
  555.             LOG         *    = supports Get/Set Logical Device
  556.  
  557.             CLK         *    = this is the clock device
  558.  
  559.             NUL         *    = this is the NUL device
  560.  
  561.             SOT         *    = this is this standard output device
  562.  
  563.             SIN    for block devices:
  564.                         *    = supports generic IOCTL
  565.                    for character devices
  566.                         *    = this is the standard input device
  567.  
  568.         Note that <space> implies the opposite of <*>; for example, an
  569.         asterisk in IOC indicates that the device supports IOCTL calls,
  570.         while a space there indicates that IOCTL is not supported.
  571.  
  572.         Also note that DOS does not provide any documented way for
  573.         programs to find the chain of device drivers.  If PMAP is unable
  574.         to find the chain, it will tell you so.
  575.  
  576.  
  577.         Device driver size; order of list
  578.         ---------------------------------
  579.         PMAP cannot reliably determine the size of the default devices
  580.         (CON, PRN, AUX, COM1, etc.) that are loaded automatically by DOS
  581.         (they share code and data).  These will all show an address
  582.         beginning with "0070", and their sizes will not be displayed.
  583.         However, if you load a replacement for one of these devices (for
  584.         example, ANSI.SYS loads a replacement for CON), PMAP will
  585.         generally be able to determine and display its size.
  586.  
  587.         The devices are shown in the order in which DOS searches for
  588.         them.  If there are two or more devices with the same name, the
  589.         one that DOS will use is the first one listed.  For example, you
  590.         will have two or more CON devices if you use ANSI.SYS; the
  591.         ANSI.SYS CON will be listed before the default CON.  DOS will
  592.         use the first one listed (ANSI.SYS).
  593.  
  594.  
  595.       | Disconnected high memory chains
  596.       | -------------------------------
  597.       | DOS manages memory by using a "chain" of allocated memory blocks
  598.       | as described below.  This chain normally ends at the 640K mark
  599.       | (segment A000), as memory addresses above this address are
  600.       | reserved for use by video adapters (some programs such as
  601.       | EEMRAM, QEMM, and 386MAX may extend the chain to B000 or B800).
  602.       | By following the links in this chain, PMAP is able to map your
  603.       | DOS memory and determine what programs own what areas of memory.
  604.       |
  605.       | However, Quarterdeck's QEMM and Qualitas' 386MAX may create an
  606.       | additional chain of allocated memory blocks in "high RAM" above
  607.       | the video adapter memory area.  Using a "high load" feature,
  608.       | these programs can load your resident utilities and device
  609.       | drivers into the high RAM chain, thus increasing the memory
  610.       | available to DOS in low RAM.
  611.       |
  612.       | The high RAM chain is not connected to DOS's standard low RAM
  613.       | chain (unless you use 386MAX's OPENHIGH option), and versions of
  614.       | PMAP prior to 2.0 would not find it; therefore programs loaded
  615.       | into high RAM were not displayed.
  616.       |
  617.       | Beginning with version 2.0, however, PMAP attempts to locate
  618.       | these "high memory chains" and identify the programs loaded
  619.       | there.  If PMAP succeeds in finding the chain and there are
  620.       | programs loaded in it, such programs will be marked with an
  621.       | asterisk (*) in the program display.  In raw block display mode
  622.       | (/R), the two chains (low and high) are shown separately.
  623.       |
  624.       | NOTE:  PMAP has no internal knowledge of QEMM, 386MAX, or
  625.       | similar programs; the presence of high memory chains is
  626.       | determined empirically.  The possibility exists that PMAP may
  627.       | occasionally report an artifact chain:  something that looks to
  628.       | PMAP like a high memory chain but really isn't.  You should be
  629.       | able to tell by looking at the displays (especially the /R raw
  630.       | display) if such a chain has been found.
  631.  
  632.         Interrupt vectors
  633.         -----------------
  634.         Many times interrupts are "intercepted" by more than one
  635.         resident program.  PMAP will only show a vector attached to the
  636.         LAST program that intercepted it.  For example, KBFIX2 shows
  637.         that it has intercepted vectors 8, 9, and 16.  However, RXINTMGR
  638.         and SDUMP could also have intercepted any or all of these three
  639.         vectors, and PMAP would not know about that.
  640.  
  641.         PMAP assumes that any vector that points into memory owned by a
  642.         program has been intercepted by that program.  That is not
  643.         always true, so you may occasionally see spurious vectors
  644.         attached to a program.
  645.  
  646.  
  647.         More about parents
  648.         ------------------
  649.         Every program has a "parent"; if program B was executed by
  650.         program A, then A is B's parent.  In most cases, the parent will
  651.         be COMMAND.COM, because most PC programs are executed by
  652.         COMMAND.COM.
  653.  
  654.         However, any program can execute any other program (assuming
  655.         that there is sufficient memory, etc.).  This is how "shells"
  656.         work.  For example, current versions of WordPerfect and many
  657.         other programs allow you to "exit to DOS"; what they usually do
  658.         is execute COMMAND.COM, which then displays a DOS prompt and
  659.         allows you to enter any commands that you wish.  If you run
  660.         PMAP, you will see two copies of COMMAND.COM in memory.
  661.  
  662.         However, you may notice that the second copy of COMMAND.COM
  663.         shows COMMAND.COM as its parent.  Logically, you would expect
  664.         the parent to be (in this case) WordPerfect.  Unfortunately,
  665.         some versions of COMMAND.COM (the one that comes with DOS 3.2,
  666.         for example) fool around with the area of memory that PMAP uses
  667.         to find the parent's address; rather than having the parent's
  668.         address, COMMAND.COM puts its own address there.  In effect,
  669.         COMMAND.COM is always its own parent.
  670.  
  671.         In general, programs that allow you to execute other programs
  672.         can use one of two methods: they can execute the other programs
  673.         directly, or the can execute COMMAND.COM and ask it to run the
  674.         requested program.  If the former, PMAP will show the true
  675.         parent; if the latter, PMAP will show COMMAND.COM, and
  676.         COMMAND.COM will be its own parent.
  677.  
  678.         Here is part of a PMAP display that shows a direct-execution
  679.         under DOS 3.2:
  680.  
  681.             Addr  Program    Parent   Han  Blks    Size    Vectors
  682.             ----  -------   --------  ---  ----   -------  -------
  683.             ...
  684.             3222  xced      command     0     2     26016
  685.             387E  qe        xced        0     3     97232
  686.             503E  command   command     0     3      3488  22 23 24
  687.             ...
  688.  
  689.         The XCED program was run by COMMAND.COM (from the DOS prompt).
  690.         It then ran the program QE directly, i.e., without reloading
  691.         COMMAND.COM.  Finally, a "shell" exit was taken from QE, which
  692.         did reload COMMAND.COM; notice that COMMAND shows as its own
  693.         parent.
  694.  
  695.  
  696.         File handles
  697.         ------------
  698.         The "Han" field of the standard memory display shows the number
  699.         of file handles that are associated with each program.  For the
  700.         most part, this field will be zero.  Some open handles may show
  701.         for programs that are active (for example, the active program
  702.         named "dbase" in the first example has 16 open files).
  703.  
  704.       | Use the /F option to see the names of the open files.
  705.  
  706.         You may see some resident programs that show one or more open
  707.         handles.  This usually occurs when you redirect the program's
  708.         start-up logo to NUL, and the program fails to close its
  709.         standard files before exiting back to DOS (this really shouldn't
  710.         be necessary, but it is).  These open handles may reduce the
  711.         number of files your application programs can have
  712.         simultaneously open.  We prefer not to redirect programs' logos
  713.         to NUL.  We save file handles; we get to see the names of the
  714.         nice people who wrote our software, and their copyrights; and we
  715.         don't lose the error messages that explain why the program isn't
  716.         doing what we thought it should.  Sounds like a bargain.
  717.  
  718.  
  719.         Multi-tasking/task-switching programs
  720.         -------------------------------------
  721.         ... play havoc with the memory allocation chain.  PMAP may
  722.         not yield very much useful information under such programs.
  723.  
  724.  
  725.         DOS's memory allocation chain
  726.         -----------------------------
  727.         This information is almost totally undocumented by Microsoft, so
  728.         take it for what's it's worth.  It's provided for informational
  729.         purposes only, and could vary from DOS version to DOS version.
  730.  
  731.         DOS (version 2.00 or later) manages memory as a chain of
  732.         "blocks".  Each block begins on a paragraph boundary, can be (in
  733.         theory) almost a megabyte in size, and is preceded immediately
  734.         by a 16-byte Memory Control Block (MCB), sometimes known as an
  735.         "arena header".  The lowest (the 80x8x interrupt vectors, BIOS
  736.         and DOS data areas, DOS itself, device drivers, etc.) and
  737.         highest (video buffers, ROM modules) portions of memory are not
  738.         mapped, but the rest of memory is.  Thus, memory can be pictured
  739.         like this:
  740.  
  741.             paragraph   contents
  742.             ---------
  743.               0000      low memory (unmapped)
  744.                         first MCB (16 bytes)
  745.                         first memory block
  746.                         next MCB
  747.                         next memory block
  748.                         ...
  749.                         last MCB
  750.                         last memory allocation block
  751.               nnnn      end of DOS memory (640K, for example)
  752.  
  753.         The address of the first MCB will vary, depending on your
  754.         version of DOS, and the number and size of device drivers,
  755.         buffers, stacks, etc., that you loaded via CONFIG.SYS.  In all
  756.         current versions of DOS (verified through 4.01), the segment
  757.         address of the first MCB can be obtained via DOS function 52H.
  758.         On return from this function, the address of the first MCB is
  759.         located at ES:[BX-2].  Here is sample code that returns the
  760.         address of the first MCB in AX:
  761.  
  762.             mov ah,52H
  763.             int 21H
  764.             mov ax,es:[bx-2]
  765.  
  766.         The MCB itself is a 16-byte region of memory that with fields as
  767.         follows:
  768.  
  769.             Offset  Size    Contents
  770.             ------  ----    --------
  771.             0       Byte    'M': this is not the last MCB
  772.                             'Z': this is the last MCB
  773.                             anything else: memory control blocks
  774.                             destroyed.  DOS will politely crash.
  775.  
  776.             1       Word    The segment address of the program that owns
  777.                             this block of memory (the program's PSP).
  778.  
  779.             3       Word    The size of the block, in paragraphs
  780.  
  781.             5-7             Reserved
  782.  
  783.             8-15     n/a    8-char (blank-filled) name of owner program
  784.                             (DOS 4.0+ only)
  785.  
  786.         This structure provides all of the information needed to step
  787.         through the memory allocation chain.  A basic algorithm is as
  788.         follows:
  789.  
  790.             Set MCB = segment of first MCB (as described above)
  791.             Do Until byte (MCB:0) = 'Z'
  792.                 If byte (MCB:0) isn't 'M' or 'Z',
  793.                     Then there's a big problem (the system is about
  794.                     to crash with a "memory allocation error")
  795.                 Block_owner = word (MCB:1)
  796.                 Block_size = word (MCB:3)
  797.                 MCB = MCB + block_size + 1
  798.             End
  799.  
  800.         EMS and EEMS memory is not, of course, mapped by DOS.
  801.  
  802.         For more complete detail about DOS's memory allocation, see
  803.         "Managing Memory" by William J. Redmond in PC Tech Journal,
  804.         August, 1984 (Vol. 2, No. 2).
  805.  
  806.  
  807.         Version 2.02
  808.         ------------
  809.         - Fixes a problem with the "largest conventional free block".
  810.         - Fixes problems with sizes of certain device drivers.
  811.         - Fixes problem with stack size display when "STACKS=0,0".
  812.         - Doesn't show the DOS data area as "unallocated".
  813.         - Increases the maximum allowable number of files, buffers, and
  814.           FCBs to 255 each (from 100).
  815.         - Reduces chance of displaying spurious high memory chains.
  816.         - Displays name field of environment (/E switch) only if all
  817.           characters in the field are in the displayable ASCII range
  818.           (33..127).
  819.         - Displays name field in raw display only if the field contains
  820.           an 8-character, blank-filled, displayable ASCII string, and
  821.           only if the block owns itself (implying that it's a program).
  822.         - Shows segment address of environment (/E switch).
  823.  
  824.         Version 2.01 (6/7/90)
  825.         ---------------------
  826.         Fixes a problem that prevented PMAP from working on systems
  827.         with no expanded memory.
  828.  
  829.         Version 2.00 (6/5/90)
  830.         -----------------------
  831.         - Attempts to identify disconnected high-RAM chains
  832.         - Adds /F (files) option
  833.         - Adds /E (environment) option
  834.         - Adds /K (kernel display) option and identifies areas of the
  835.           DOS data block used for files, buffers, stacks, etc.
  836.         - Adds /Q (quick display) option
  837.         - Supports permanent options via PMAP variable
  838.         - Correctly reports size of last installed device driver
  839.         - Supports altered switch characters
  840.         - Shows program name in raw display if available from
  841.           environment.
  842.         - Uses correct number of available file handles with extended
  843.           handle tables (old versions assumed 20 handles)
  844.  
  845.         Version 1.34 (11/15/88)
  846.         -----------------------
  847.         Fixes a bug in 1.33 for resident programs that release their
  848.         environments under DOS 4.0.
  849.  
  850.         Version 1.33 (11/14/88)
  851.         -----------------------
  852.         Uses a new feature of DOS 4.0 to more reliably obtain names of
  853.         resident programs, including those installed via INSTALL.
  854.  
  855.         Version 1.31/1.32 (7/29/88)
  856.         -----------------
  857.         Displays number of open handles for each PSP.
  858.         Displays sizes of some devices (/V switch).
  859.         Improved display when too many vectors to fit on one line.
  860.         Fixed spurious errorlevel returned by successful run (32).
  861.  
  862.         Version 1.30
  863.         ------------
  864.         Adds /X, /S, and /? switches.
  865.         Adds device driver display (/V).
  866.         Displays names of EMS-users when available (LIM 4.0 only).
  867.         Allows wildcards in program-list.
  868.         Fixes problem with name of secondary copies of COMMAND.COM
  869.             under DOS 3.3 (it's not available).
  870.  
  871.         Version 1.26
  872.         ------------
  873.         Corrects a problem detecting extended memory with certain
  874.         versions of BIOS ROM.
  875.  
  876.         Version 1.25
  877.         ------------
  878.         Adds the extended memory display and the selective display
  879.         option.
  880.  
  881.         Corrects a minor problem with DOS 3.3.
  882.  
  883.         Version 1.21
  884.         ------------
  885.         Bug fixes to version 1.20:
  886.  
  887.         1. No more runaway display when EMS memory is present but none
  888.         of it is in use.
  889.  
  890.         2. PMAP is more careful about what it thinks is the name of the
  891.         command shell.
  892.  
  893.  
  894.         Copyright/License/Warranty
  895.         --------------------------
  896.         This document and the program file PMAP.EXE ("the software") are
  897.         copyrighted by the author.  The copyright owner hereby licenses
  898.         you to: use the software; make as many copies of the program and
  899.         documentation as you wish; give such copies to anyone; and
  900.         distribute the software and documentation via electronic means.
  901.         There is no charge for any of the above.
  902.  
  903.         However, you are specifically prohibited from charging, or
  904.         requesting donations, for any such copies, however made; and
  905.         from distributing the software and/or documentation with
  906.         commercial products without prior permission.  An exception is
  907.         granted to not-for-profit user's groups, which are authorized to
  908.         charge a small fee (not to exceed $7) for materials, handling,
  909.         postage, and general overhead.  NO FOR-PROFIT ORGANIZATION IS
  910.         AUTHORIZED TO CHARGE ANY AMOUNT FOR DISTRIBUTION OF COPIES OF
  911.         THE SOFTWARE OR DOCUMENTATION, OR TO INCLUDE COPIES OF THE
  912.         SOFTWARE OR DOCUMENTATION WITH SALES OF THEIR OWN PRODUCTS.
  913.  
  914.         THIS INCLUDES A SPECIFIC PROHIBITION AGAINST FOR-PROFIT
  915.         ORGANIZATIONS DISTRIBUTING THE SOFTWARE, EITHER ALONE OR WITH
  916.         OTHER SOFTWARE, AND CHARGING A "HANDLING" OR "MATERIALS" FEE OR
  917.         ANY OTHER SUCH FEE FOR THE DISTRIBUTION.  NO FOR-PROFIT
  918.         ORGANIZATION IS AUTHORIZED TO INCLUDE THE SOFTWARE ON ANY MEDIA
  919.         FOR WHICH MONEY IS CHARGED.  PERIOD.
  920.  
  921.         There is no restriction on the use of this software in
  922.         commercial or institutional environments.
  923.  
  924.         No copy of the software may be distributed or given away without
  925.         this document; and this notice must not be removed.
  926.  
  927.         There is no warranty of any kind, and the copyright owner is not
  928.         liable for damages of any kind.  By using this free software,
  929.         you agree to this.
  930.  
  931.         The software and documentation are:
  932.  
  933.                     Copyright (C) 1986, 1987, 1988, 1990 by
  934.                             Christopher J. Dunford
  935.                             The Cove Software Group
  936.                                  P.O. Box 1072
  937.                            Columbia, Maryland 21044
  938.  
  939.                                 (301) 992-9371
  940.                         CompuServe 76703,2002 [IBMNET]
  941.